package com.ruoyi.banks.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.banks.mapper.BankMapper;
import com.ruoyi.banks.domain.Bank;
import com.ruoyi.banks.service.IBankService;

/**
 * 题库Service业务层处理
 * 
 * @author 石晨臣
 * @date 2024-11-25
 */
@Service
public class BankServiceImpl implements IBankService 
{
    @Autowired
    private BankMapper bankMapper;

    /**
     * 查询题库
     * 
     * @param id 题库主键
     * @return 题库
     */
    @Override
    public Bank selectBankById(Long id)
    {
        return bankMapper.selectBankById(id);
    }

    /**
     * 查询题库列表
     * 
     * @param bank 题库
     * @return 题库
     */
    @Override
    public List<Bank> selectBankList(Bank bank)
    {
        return bankMapper.selectBankList(bank);
    }

    /**
     * 新增题库
     * 
     * @param bank 题库
     * @return 结果
     */
    @Override
    public int insertBank(Bank bank)
    {
        bank.setCreateTime(DateUtils.getNowDate());
        return bankMapper.insertBank(bank);
    }

    /**
     * 修改题库
     * 
     * @param bank 题库
     * @return 结果
     */
    @Override
    public int updateBank(Bank bank)
    {
        return bankMapper.updateBank(bank);
    }

    /**
     * 批量删除题库
     * 
     * @param ids 需要删除的题库主键
     * @return 结果
     */
    @Override
    public int deleteBankByIds(Long[] ids)
    {
        return bankMapper.deleteBankByIds(ids);
    }

    /**
     * 删除题库信息
     * 
     * @param id 题库主键
     * @return 结果
     */
    @Override
    public int deleteBankById(Long id)
    {
        return bankMapper.deleteBankById(id);
    }
}
